package com.varton.demo.abstracts;

import com.varton.demo.method.AdidasFactroy;
import com.varton.demo.method.AntaFactroy;
import com.varton.demo.method.MethodFactory;
import com.varton.demo.method.NickFactory;

/**
 *
 * @author lihuazeng
 */
public abstract class AbstractFactory {
    public static MethodFactory getFactory(String name){
        if ("nick".equals(name)){
            return new NickFactory();
        }else if ("adidas".equals(name)){
            return new AdidasFactroy();
        } else if ("anta".equals(name)){
            return new AntaFactroy();
        }else {
            return null;
        }
    }
}